package com.view.autoservice;

import android.util.Log;

import androidx.fragment.app.Fragment;

import com.view.baselib.IApplication;

import java.util.ServiceLoader;
import java.util.function.Consumer;

/**
 * Author: Wu Chang
 * <p>
 * Date: 2024/7/25 10:31
 */
public class ServiceLoad {

    public static void load() {
        ServiceLoader.load(IApplication.class).iterator().forEachRemaining(new Consumer<IApplication>() {
            @Override
            public void accept(IApplication iApplication) {
                Log.d("ServiceLoad", iApplication.getClass().getName());
                Fragment fragment = iApplication.mainPagerFragment(BuildConfig.MODULE);
            }
        });
    }
}
